package dto;

/**
 * @author Evan
 *
 */
public class MessageDTO {
	private int msg_no;
	private String msg_content;
	private String writer;
	private String reader;
	private String msg_date;
	private int roomNo;
	private RoomDTO roomDTO;
	
	public MessageDTO() {}
	public MessageDTO(int msg_no, String msg_content, String writer,
			String reader, String msg_date, int roomNo, RoomDTO roomDTO) {
		this.msg_no = msg_no;
		this.msg_content = msg_content;
		this.writer = writer;
		this.reader = reader;
		this.msg_date = msg_date;
		this.roomNo = roomNo;
		this.roomDTO = roomDTO;
	}
	public int getMsg_no() {
		return msg_no;
	}
	public void setMsg_no(int msg_no) {
		this.msg_no = msg_no;
	}
	public String getMsg_content() {
		return msg_content;
	}
	public void setMsg_content(String msg_content) {
		this.msg_content = msg_content;
	}
	public String getWriter() {
		return writer;
	}
	public void setWriter(String writer) {
		this.writer = writer;
	}
	public String getreader() {
		return reader;
	}
	public void setreader(String reader) {
		this.reader = reader;
	}
	public String getMsg_date() {
		return msg_date;
	}
	public void setMsg_date(String msg_date) {
		this.msg_date = msg_date;
	}
	public int getroomNo() {
		return roomNo;
	}
	public void setroomNo(int roomNo) {
		this.roomNo = roomNo;
	}
	public RoomDTO getRoomDTO() {
		return roomDTO;
	}
	public void setRoomDTO(RoomDTO roomDTO) {
		this.roomDTO = roomDTO;
	}
	@Override
	public String toString() {
		return "MessageDTO [msg_no=" + msg_no + ", msg_content=" + msg_content
				+ ", writer=" + writer + ", reader=" + reader
				+ ", msg_date=" + msg_date + ", roomNo=" + roomNo + "]";
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((msg_content == null) ? 0 : msg_content.hashCode());
		result = prime * result
				+ ((msg_date == null) ? 0 : msg_date.hashCode());
		result = prime * result + msg_no;
		result = prime * result
				+ ((reader == null) ? 0 : reader.hashCode());
		result = prime * result + roomNo;
		result = prime * result + ((writer == null) ? 0 : writer.hashCode());
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		MessageDTO other = (MessageDTO) obj;
		if (msg_content == null) {
			if (other.msg_content != null)
				return false;
		} else if (!msg_content.equals(other.msg_content))
			return false;
		if (msg_date == null) {
			if (other.msg_date != null)
				return false;
		} else if (!msg_date.equals(other.msg_date))
			return false;
		if (msg_no != other.msg_no)
			return false;
		if (reader == null) {
			if (other.reader != null)
				return false;
		} else if (!reader.equals(other.reader))
			return false;
		if (roomNo != other.roomNo)
			return false;
		if (writer == null) {
			if (other.writer != null)
				return false;
		} else if (!writer.equals(other.writer))
			return false;
		return true;
	}
	
	
}
	